{#{% extends 'base.html' %}#}
{% extends 'layout.html' %}
{#{% load static %}#}
{#{% block title %}数据采集白名单{% endblock %}#}

{#{% block contentmain %}#}
{% block content %}
    <div class="container-fluid" style="margin-top:55px;">
        <!-- 查询表单 -->
        <div class="row" style="margin: 2px">
            <div class="col-md-12" style="padding-left: 0px">
                <form class="form-horizontal" role="form" target="iframe">
                    {% csrf_token %}
                    <div class="form-group" style="margin-bottom: 5px">
                        <!-- 领域输入 -->
                        <div class="col-sm-1 control-label">领域</div>
                        <div class="col-sm-2">
                            <select id="domain" class="form-control" mustwrite="true" title="领域">
                                {% for domain in obj_list %}
                                    <option value="{{ domain }}">{{ domain }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <!-- 账号/姓名输入 -->
                        <div class="col-sm-1 control-label"><span class="required" style="color:red">*</span>账号</div>
                        <div class="col-sm-2">
                            <input id="operation_user" type="text" class="form-control">
                        </div>
                        <!-- 账号/姓名输入 -->
                        <div class="col-sm-1 control-label"><span class="required" style="color:red">*</span>姓名</div>
                        <div class="col-sm-2">
                            <input id="operation_user_name" type="text" class="form-control">
                        </div>
                        <!-- 岗位输入 -->
                        <div class="col-sm-1 control-label"><span class="required" style="color:red">*</span>岗位</div>
                        <div class="col-sm-2">
                            <input id="position" type="text" class="form-control">
                        </div>
                    </div>

                    <div class="form-group" style="margin-bottom: 0px;" style="border: 1px solid #000;">
                        <div style="margin-bottom: 0px;" class="col-sm-12">
                            <button id="btnExt" type="button" class="btn btn-primary queryButton pull-right" style="margin-left: 10px;">查询</button>
                            <button id="restid" type="button" class="btn queryButton pull-right" style="margin-left: 10px;">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <!-- 操作工具栏 -->
        <div id="toolbar" class="row" style="margin-top: 0px;margin-bottom: -5px;">
            <div class="btn-group" style="margin-left: 10px">
                {#        {% if perms.tools.add_ttestapiwebuser %}#}
                <button id="add" class="btn btn-primary btn-xs" style="margin-left: 10px">新增</button>
                {#        {% endif %}#}
                {#        {% if perms.tools.change_ttestapiwebuser %}#}
                <button id="modify" class="btn btn-primary btn-xs" style="margin-left: 10px">修改</button>
                {#        {% endif %}#}
                {#        {% if perms.tools.delete_ttestapiwebuser %}#}
                <button id="delete" class="btn btn-primary btn-xs" style="margin-left: 10px">删除</button>
                {#        {% endif %}#}
{#                <button id="btnExt" class="btn btn-primary queryButton" style="margin-left: 10px">查询</button>#}
{#                <button id="restid" class="btn queryButton" style="margin-left: 10px">重置</button>#}
            </div>
        </div>

        <!-- 数据表格 -->
        <div class="row" style="margin: 8px;margin-top: -10px;">
            <div class="col-sm-12">
                <table id="articles-table" data-toggle="tabls" class="table table-hover table-bordered table-responsive text-nowrap table-striped">
                    <!-- 表格内容通过JS动态加载 -->
                </table>
            </div>
        </div>
    </div>

{#    <!-- 新增人员模态框 -->#}
{#    <div class="modal fade" id="add-article-modal" tabindex="-1" role="dialog">#}
{#        <div class="modal-dialog" role="document">#}
{#            <div class="modal-content">#}
{#                <div class="modal-header">#}
{#                    <button type="button" class="close" data-dismiss="modal">&times;</button>#}
{#                    <h4 class="modal-title">添加人员白名单</h4>#}
{#                </div>#}
{#                <form id="add-modal-form" class="form-horizontal">#}
{#                    <div class="modal-body">#}
{#                        <input type="hidden" id="add-modal-id">#}
{#                        <!-- 包含与主表单相同的字段 -->#}
{#                    </div>#}
{#                    <div class="modal-footer">#}
{#                        <button type="submit" class="btn btn-primary">保存</button>#}
{#                    </div>#}
{#                </form>#}
{#            </div>#}
{#        </div>#}
{#    </div>#}

{% comment %}
    <!--新增-->
    <div class="modal fade" id="add-article-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
         aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                    <h4 class="modal-title">添加人员白名单</h4>
                </div>
                <form id="add-modal-form" class="form-horizontal" action="">
                    <div class="modal-body">
                        <input type="hidden" id="add-modal-id"/>

                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal align-right"><span
                                    class="required" style="color:red">*</span>领域：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <select id='add_domain' class="form-control" type="text" mustwrite="true" title="领域">
                                    {% for domain in obj_list %}
                                        <option value="{{ domain }}">{{ domain }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3col-xl-3 control-label font-normal align-right"><span class="required"
                   style="color:red">*</span>账号：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <div class="file-input-container">
                                    <input type="text" id="add_operation_user" class="form-control"/>
                                </div>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal align-right"><span class="required" style="color:red">*</span>姓名：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <div class="file-input-container">
                                    <input type="text" id="add_operation_user_name" class="form-control"/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal align-right"><span class="required" style="color:red">*</span>岗位：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <div class="file-input-container">
                                    <input type="text" id="add_position" class="form-control"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-success" id="submit-button">发送</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <!--修改-->
    <div class="modal fade" id="modify-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
         aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×
                    </button>
                    <h4 class="modal-title">修改人员白名单</h4>
                </div>
                <form id="add-modal-form" class="form-horizontal" action="">
                    <div class="modal-body">
                        <input type="hidden" id="modify-modal-id"/>
                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal align-right"><span class="required" style="color:red">*</span>领域：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <select id='update_domain' class="form-control" type="text" mustwrite="true" title="领域">
                                    {% for domain in obj_list %}
                                        <option value="{{ domain }}">{{ domain }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal align-right"><span class="required" style="color:red">*</span>账号：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <div class="file-input-container">
                                    <input type="text" id="update_operation_user" class="form-control" disabled="disabled"/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal align-right"><span class="required" style="color:red">*</span>姓名：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <div class="file-input-container">
                                    <input type="text" id="update_operation_user_name" class="form-control"/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-md-3 col-lg-3 col-xl-3 control-label font-normal col-xl-3 control-label font-normal align-right"><span class="required" style="color:red">*</span>岗位：</label>
                            <div class="col-sm-7 col-md-7 col-lg-7 col-xl-7">
                                <div class="file-input-container">
                                    <input type="text" id="update_position" class="form-control"/>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <button type="submit" class="btn btn-success" id="modify-modal-form-submit">发送</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endcomment %}

    <script>
        toastr.options.positionClass = 'toast-top-center';
        toastr.options.timeOut = '2000';
    </script>

    <script>
        {#setScroll();#}
        var changeRows = new Array();
        var $articlesTable = $('#articles-table').bootstrapTable('destroy').bootstrapTable({
            url: "{% url 'search_data_collection_whitelist' %}",
            method: 'GET',
            dataType: "json",
            uniqueId: 'id',
            striped: true,
            cache: true,
            sortable: true,
            clickEdit: true,
            editable: true,
            theadClasses: "bg-info",//这里设置表头样式
            sidePagination: "server",
            resizable: true, //可调整列宽度
            height: parseInt($
            (window).height()) - 126, //动态获取高度值，可以使表格自适应页面
            undefinedText: '0',
            singleSelect: false,
            toolbar: '#toolbar',
            {#search: true,#}
            {#showToggle: true,          //是否显示详细视图和列表视图的切换按钮#}
            {#showRefresh: true,          //是否显示刷新按钮#}
            {#showColumns: true,          //是否显示所有的列#}
            strictSearch: true,
            clickToSelect: true,
            pagination: true,
            pageNumber: 1,
            pageSize: 200,
            pageList: [200, 500, 1000, 2000],
            smartDisplay: false,
            paginationPreText: "上一页",
            queryParamsType: "",
            {#fixedColumns: true,#}
            {#fixedNumber: 1,#}
            {#fixedFrom: 'left', // 左侧为 left#}
            queryParams: function (params) {
                var param = {
                    pageNumber: params.pageNumber,
                    pageSize: params.pageSize,
                    sortName: params.sortName,
                    sortOrder: params.sortOrder,
                    domain: $("#domain").val(),
                    operation_user: $("#operation_user").val(),
                    operation_user_name: $("#operation_user_name").val(),
                    position: $("#position").val(),
                };
                return param;
            },
            columns: [{
                checkbox: true,
                visible: true,        //是否显示复选框
            }, {
                field: 'domain',
                title: '领域',
                align: 'center',
            }, {
                field: 'operation_user',
                title: '账号',
                align: 'center',
            }, {
                field: 'operation_user_name',
                title: '姓名',
                align: 'center',
            }, {
                field: 'position',
                title: '岗位',
                align: 'center',
            }, {
                field: 'create_by',
                title: '创建人',
                align: 'center',
            }, {
                field: 'create_date',
                title: '创建时间',
                align: 'center',
            }, {
                field: 'last_update_by',
                title: '更新人',
                align: 'center',
            }, {
                field: 'last_update_date',
                title: '更新时间',
                align: 'center',
            }],
            onLoadError: function () {
                toastr.error("数据加载失败！", "错误提示");
            },
            onClickRow: function (row, $element) {
                // EditViewById(id, 'view');
            },

        });
    </script>

    <script>
        //查询
        $('#btnExt').on('click', function () {
            $('#articles-table').bootstrapTable('refresh');
        });
        //重置按钮
        $('#restid').on('click', function () {
            $("#operation_user").val("");
            $("#operation_user_name").val("");
            $("#position").val("");
        });
{% comment %}

        //新增
        $("#add").click(function () {
            $("#add-article-modal").modal("show");
        })
        $("#submit-button").click(function (e) {
            e.preventDefault();
            $.ajax({
                    cache: false,
                    type: "POST",
                    url: '{% url 'insert_data_collection_whitelist' %}',
                    //traditional: true, //加上此项可以传数组
                    dataType: 'json',
                    data: {
                        domain: $("#add_domain").val(),
                        operation_user: $("#add_operation_user").val(),
                        operation_user_name: $("#add_operation_user_name").val(),
                        position: $("#add_position").val(),
                    },
                    success: function (data) {
                        if (data.ret) {
                            $("#add-article-modal").modal("hide");
                            toastr.success("数据添加成功！", "成功提示！");
                            $articlesTable.bootstrapTable("refresh");
                        } else {
                            toastr.warning(data.msg, "告警提示！");
                        }
                    }
                }
            );

            // 修改
            $("#modify").click(function (ee) {
                ee.preventDefault();
                
            var checkbox = $('#articles-table').bootstrapTable('getSelections');//获取选中的数据
            var ids = [];
            for (var i = 0; i <
            checkbox.length; i++) {
                var id = checkbox[i].id;//获取选择行的值
                ids.push(id)
            }

            if (ids.length === 0) {
                toastr.warning('需要选中一条数据', "告警提示");
                return; // 如果选择的数据数量不正确，显示警告信息并立即返回
            }

            if (ids.length >= 2) {
                toastr.warning('请选择单条数据进行修改', "告警提示");
                return; // 如果选择的数据数量不正确，显示警告信息并立即返回
            }

            $('#modify-modal').modal('show');
            $('#modify-modal-id').val(ids[0]);

            $.ajax({
                cache: false,
                type: "POST",
                url: '{% url 'search_data_collection_whitelist_byid'%}',
                dataType: 'json',
                data: {'id': ids[0]},
                success: function (data) {
                    if (data.ret) {
                        $("#update_domain").val(data.data.domain);
                        $("#update_operation_user").val(data.data.operation_user);
                        $("#update_operation_user_name").val(data.data.operation_user_name);
                        $("#update_position").val(data.data.position);
                    }
                }
            });
        })

        $("#modify-modal-form-submit").click(function (e) {
            e.preventDefault();
            $.ajax({
                cache: false,
                type: "POST",
                url: '{% url 'update_data_collection_whitelist' %}',
                dataType: 'json',
                data: {
                    id: $("#modify-modal-id").val(),
                    domain: $("#update_domain").val(),
                    operation_user: $("#update_operation_user").val(),
                    operation_user_name: $("#update_operation_user_name").val(),
                    position: $("#update_position").val(),
                },
                success: function (data) {
                    if (data.ret) {
                        $("#modify-modal").modal("hide");
                        toastr.success(data.msg, "成功提示");
                        $articlesTable.bootstrapTable("refresh");
                    } else {
                        toastr.warning(data.msg, "告警提示");
                    }
                }
            });
        })


        // 删除
        $("#delete").click(function (e) {
            e.preventDefault();
            var checkbox = $(
                "#articles-table").bootstrapTable('getSelections'); //获取选中的数据
            var ids = [];
            for (var i = 0; i <
            checkbox.length; i++) {
                var id = checkbox[i].id;//获取选择行的值
                ids.push(id)
            }

            $.ajax({
                cache: false,
                type: "POST",
                url: {% url 'delete_data_collection_whitelist' %},
                dataType: 'json',
                data: {"ids": ids},
                success: function (data) {
                    if (data.ret) {
                        toastr.success(data.msg,
                            "成功提示");
                        $articlesTable.bootstrapTabl
                        e("refresh");
                    } else {
                        toastr.error(data.msg, "失败提示");
                    }
                }
            });
        })
{% endcomment %}

        //自动化适配屏幕
        $(window).resize(function () {
            var windowHeight = $(window).height();
            var newHeight = windowHeight - 126;
            $('#articles-table').bootstrapTable('resetView',
                {
                    height: newHeight
                });
        });

        //解决查询后表头和表体不对齐的问题
        $(document).on('post-header.bs.table',
            '#articles-table', function () {
                // 原理：水平滚动条向左滚动1像素，bootstrap-table会自动调整标题栏和内容栏对齐
                $(".fixed-table-body").scrollLeft($(".fixed-table-body").scrollLeft() - 1);
            });

        //时间组件
        $(function () {
            $("#datepicker input").datepicker({
                format: 'yyyy-mm-dd',
                //startDate: '+0d',//设置开始日期为当前日期
                language: "zh-CN",
                autoclose: true,
            });
        });
        // 时间组件
        $(function () {
            var today = new Date();
            var dd = String(today.getDate()).padStart(2, '0');
            var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
            var yyyy = today.getFullYear();
            today = yyyy + '-' + mm + '-' + dd;
            $('#created_date_start').val(today);
        });
    </script>
{% endblock %}


{#        <!-- 修改人员模态框 -->#}
{#        <div class="modal fade" id="modify-modal" tabindex="-1" role="dialog">#}
{#            <div class="modal-dialog" role="document">#}
{#                <div class="modal-content">#}
{#                    <div class="modal-header">#}
{#                        <button type="button" class="close" data-dismiss="modal">&times;</button>#}
{#                        <h4 class="modal-title">修改人员信息</h4>#}
{#                    </div>#}
{#                    <form id="modify-modal-form" class="form-horizontal">#}
{#                        <div class="modal-body">#}
{#                            <input type="hidden" id="modify-modal-id">#}
{#                            <!-- 包含与主表单相同的字段 -->#}
{#                        </div>#}
{#                        <div class="modal-footer">#}
{#                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>#}
{#                            <button type="submit" class="btn btn-success" id="modify-modal-form-submit">发送</button>#}
{#                        </div>#}
{#                    </form>#}
{#                </div>#}
{#            </div>#}
{#        </div>#}
{#{% endblock %}#}

{#{% block scripts %}#}
{#<script>#}
{#// 表格初始化#}
{#var $articlesTable = $('#articles-table').bootstrapTable({#}
{#    url: '/search_data_collection_whitelist',#}
{#    method: 'GET',#}
{#    dataType: 'json',#}
{#    uniqueId: 'id',#}
{#    striped: true,#}
{#    clickEdit: true,#}
{#    theadClasses: "bg-info",#}
{#    sidePagination: "server",#}
{#    height: parseInt($(window).height())-126,#}
{#    pagination: true,#}
{#    pageSize: 200,#}
{#    smartDisplay: false,#}
{#    clickToSelect: true,#}
{#    toolbar: '#toolbar',#}
{#    columns: [{#}
{#        checkbox: true#}
{#    }, {#}
{#        field: 'domain',#}
{#        title: '领域',#}
{#        align: 'center'#}
{#    }, {#}
{#        field: 'operation_user',#}
{#        title: '账号', #}
{#        align: 'center'#}
{#    }, {#}
{#        field: 'operation_user_name',#}
{#        title: '姓名',#}
{#        align: 'center'#}
{#    }, {#}
{#        field: 'position',#}
{#        title: '岗位',#}
{#        align: 'center'#}
{#    }, {#}
{#        field: 'last_update_by',#}
{#        title: '更新人',#}
{#        align: 'center'#}
{#    }, {#}
{#        field: 'last_update_date', #}
{#        title: '更新时间',#}
{#        align: 'center'#}
{#    }]#}
{#});#}
{##}
{#// 日期组件初始化#}
{#$(function () {#}
{#    var today = new Date();#}
{#    var dd = String(today.getDate()).padStart(2, '0');#}
{#    var mm = String(today.getMonth()+1).padStart(2, '0');#}
{#    var yyyy = today.getFullYear();#}
{#    today = yyyy + '-' + mm + '-' + dd;#}
{#    $('#created_date_start').val(today);#}
{#    #}
{#    $('#datepicker.input').datepicker({#}
{#        format: 'yyyy-mm-dd',#}
{#        language: "zh-CN",#}
{#        autoclose: true#}
{#    });#}
{#});#}
{##}
{#// 重置功能#}
{#$('#restid').on('click', function() {#}
{#    $("#operation_user").val("");#}
{#    $("#operation_user_name").val("");#}
{#    $("#position").val("");#}
{#});#}
{##}
{#// 查询功能#}
{#$('#btnExt').on('click', function() {#}
{#    $('#articles-table').bootstrapTable('refresh');#}
{#});#}
{##}
{#// 新增功能#}
{#$("#add").click(function() {#}
{#    $("#add-article-modal").modal("show");#}
{#});#}
{##}
{#// 修改功能#}
{#$("#modify").click(function(e) {#}
{#    e.preventDefault();#}
{#    var checkbox = $("#articles-table").bootstrapTable('getSelections');#}
{#    var ids = [];#}
{#    #}
{#    for(var i=0; i < checkbox.length; i++) {#}
{#        ids.push(checkbox[i].id);#}
{#    }#}
{##}
{#    if(ids.length === 0){#}
{#        toastr.warning("需要选中一条数据","告警提示");#}
{#        return;#}
{#    }#}
{##}
{#    if(ids.length >= 2){#}
{#        toastr.warning("请选择单条数据进行修改","告警提示");#}
{#        return;#}
{#    }#}
{##}
{#    $.ajax({#}
{#        cache: false,#}
{#        url: '{% url "search_data_collection_whitelist_byid" %}',#}
{#        dataType: 'json',#}
{#        data: {id: ids[0]},#}
{#        success: function(data) {#}
{#            if (data.ret) {#}
{#                $("#update_domain").val(data.domain);#}
{#                $("#update_operation_user").val(data.operation_user);#}
{#                $("#update_operation_user_name").val(data.operation_user_name);#}
{#                $("#update_position").val(data.position);#}
{#                $("#modify-modal").modal("show");#}
{#                $("#modify-modal-id").val(ids[0]);#}
{#            }#}
{#        }#}
{#    });#}
{#});#}
{##}
{#// 删除功能#}
{#$("#delete").click(function (e) {#}
{#    e.preventDefault();#}
{#    var checkbox = $("#articles-table").bootstrapTable('getSelections');#}
{#    var ids = [];#}
{#    for(var i = 0; i < checkbox.length; i++) {#}
{#        ids.push(checkbox[i].id);#}
{#    }#}
{##}
{#    if(ids.length > 0){#}
{#        if(!confirm('确定要删除选中的'+ids.length+'条记录吗？')){#}
{#            return false;#}
{#        }#}
{#    }#}
{##}
{#    $.ajax({#}
{#        cache: false,#}
{#        type: "POST",#}
{#        url: 'delete_data_collection_whitelist',#}
{#        dataType: 'json',#}
{#        data: {"ids": ids},#}
{#        success: function (data) {#}
{#            if (data.ret) {#}
{#                toastr.success(data.msg, "成功提示");#}
{#                $articlesTable.bootstrapTable("refresh");#}
{#            } else {#}
{#                toastr.error(data.msg, "失败提示");#}
{#            }#}
{#        }#}
{#    });#}
{#});#}
{##}
{#// 新增表单提交#}
{#$("#submit-button").click(function(e) {#}
{#    e.preventDefault();#}
{#    $.ajax({#}
{#        type: "POST",#}
{#        url: '{% url "insert_data_collection_whitelist" %}',#}
{#        data: {#}
{#            domain: $("#add_domain").val(),#}
{#            operation_user: $("#add_operation_user").val(),#}
{#            operation_user_name: $("#add_operation_user_name").val(),#}
{#            position: $("#add_position").val()#}
{#        },#}
{#        success: function(data) {#}
{#            if (data.ret) {#}
{#                $("#add-article-modal").modal("hide");#}
{#                toastr.success("数据添加成功！", "成功提示!");#}
{#                $articlesTable.bootstrapTable("refresh");#}
{#            } else {#}
{#                toastr.warning(data.msg, "告警提示!");#}
{#            }#}
{#        }#}
{#    });#}
{#});#}
{##}
{#// 修改表单提交#}
{#$("#modify-modal-form-submit").click(function(e) {#}
{#    e.preventDefault();#}
{#    $.ajax({#}
{#        cache: false,#}
{#        type: "POST",#}
{#        url: '{% url "update_data_collection_whitelist" %}',#}
{#        dataType: 'json',#}
{#        data: {#}
{#            id: $("#modify-modal-id").val(),#}
{#            domain: $("#update_domain").val(),#}
{#            operation_user: $("#update_operation_user").val(),#}
{#            operation_user_name: $("#update_operation_user_name").val(),#}
{#            position: $("#update_position").val()#}
{#        },#}
{#        success: function(data) {#}
{#            if (data.ret) {#}
{#                $("#modify-modal").modal("hide");#}
{#                toastr.success(data.msg, "成功提示");#}
{#                $articlesTable.bootstrapTable("refresh");#}
{#            }#}
{#        }#}
{#    });#}
{#});#}
{##}
{#// 窗口大小改变时调整表格高度#}
{#$(window).resize(function () {#}
{#    var windowHeight = $(window).height();#}
{#    var newHeight = windowHeight - 126;#}
{#    $('#articles-table').bootstrapTable('resetView', {height: newHeight});#}
{#});#}
{##}
{#// 解决表头对齐问题#}
{#$(document).on('post-header.bs.table', '#articles-table', function() {#}
{#    $(".fixed-table-body").scrollLeft($(".fixed-table-body").scrollLeft()-1);#}
{#});#}
{##}
{#// 提示消息配置#}
{#toastr.options = {#}
{#    positionClass: 'toast-top-center',#}
{#    timeOut: '2000'#}
{#};#}
{#</script>#}
{#{% endblock %}#}